Skip to content

[Repo Assist] test: add 48 unit tests for StringExtensions#1759

Draft
github-actions[bot] wants to merge 2 commits intomainfrom
repo-assist/test-stringextensions-2026-04-25-258f218893f2f8d1
Draft

[Repo Assist] test: add 48 unit tests for StringExtensions#1759
github-actions[bot] wants to merge 2 commits intomainfrom
repo-assist/test-stringextensions-2026-04-25-258f218893f2f8d1

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

🤖 This is an automated pull request from Repo Assist, an AI assistant for this repository.

FSharp.Data.StringExtensions (in src/FSharp.Data.Csv.Core/CsvExtensions.fs) is a public API providing extension methods on System.String that call TextConversions methods and throw on failure rather than returning None. While TextConversions itself has thorough tests, the extension layer had no dedicated unit tests.

Changes

  • tests/FSharp.Data.Core.Tests/StringExtensions.fs — 48 new tests covering all 9 extension methods:
    • AsInteger / AsInteger64 — valid inputs, culture parameter, throw on invalid input
    • AsDecimal — valid inputs, culture-specific decimal separator
    • AsFloat — valid inputs, default missing-value strings ("N/A", "NA") → NaN, custom missing values, throw on non-numeric
    • AsBoolean — recognised true/false values, throw on unrecognised input
    • AsDateTime / AsDateTimeOffset / AsTimeSpan — valid ISO strings, throw on invalid
    • AsGuid — standard and braced form, throw on invalid

Test Status

  • dotnet test tests/FSharp.Data.Core.Tests/ --filter StringExtensions48 passed, 0 failed
  • ⚠️ Full build (dotnet run --project build/build.fsproj -t Build) fails with NU1902 (pre-existing infrastructure issue: OpenTelemetry.Api 1.15.0 has an unpatched moderate vulnerability brought in transitively by NUnit3TestAdapter; no patched version is available yet). This is not caused by these changes.

Generated by 🌈 Repo Assist, see workflow run. Learn more.

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@96b9d4c39aa22359c0b38265927eadb31dcf4e2a

Generated by 🌈 Repo Assist, see workflow run. Learn more.

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@96b9d4c39aa22359c0b38265927eadb31dcf4e2a

CsvExtensions.StringExtensions is a public API that wraps TextConversions
methods as extension methods on System.String, throwing on failure instead
of returning None. These extensions had no dedicated unit tests; this adds
coverage for all 9 methods: AsInteger, AsInteger64, AsDecimal, AsFloat,
AsBoolean, AsDateTime, AsDateTimeOffset, AsTimeSpan, AsGuid.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants